<template>
  <div class="FQA">
    <div class="item1">
      <p class="font2">{{ lang.what_is_affiliate }}</p>
      <p class="red font2">{{ lang.brz7_games }}</p>
      <p class="font1">{{ lang.affiliate_description }}</p>
    </div>
    <div class="item1">
      <p class="font2">{{ lang.how_much_cost }}</p>
      <p class="font1" style="text-align: center">{{ lang.no_cost }}</p>
    </div>
    <div class="item1">
      <p class="font2">{{ lang.no_website_benefits }}</p>
      <p class="font1">
        {{ lang.no_website_answer }}
      </p>
    </div>
    <div class="item1">
      <p class="font2">{{ lang.how_much_earn }}</p>
      <p class="font1">{{ lang.earn_description }}</p>
    </div>
    <div class="item1">
      <p class="font2">{{ lang.unlimited_development }}</p>
      <div class="img-box">
        <NuxtImg :src="assets.faqImage" alt="FAQ" />
        <div class="text">
          <div>
            <span>{{ lang.bet_discount }}</span>
            <span>{{ lang.reference_member }}</span>
          </div>
        </div>
      </div>
      <p class="font1">
        1. {{ lang.commission_percentage }}
        <span class="red">{{ lang.commission_percentage_red }}</span>
      </p>
      <p class="font1">2. {{ lang.system_calculation }}</p>
    </div>
    <div class="item1">
      <p class="font2">{{ lang.commission_calculation_rules }}</p>
      <div class="user">
        <NuxtImg :src="assets.renjImage" alt="Renj" />
        <div>
          <p class="font3">{{ lang.c3_powerful }}</p>
          <p class="font3"><span class="red">110</span> / {{ lang.million }}</p>
        </div>
      </div>
      <div class="money">
        <p class="font1">{{ lang.total_performance }}</p>
        <p class="red font1">2500</p>
      </div>
      <div class="money">
        <p class="font1">{{ lang.subordinate_performance }}</p>
        <p class="red font1">1980</p>
      </div>
      <div class="money">
        <p class="font1">{{ lang.other_performance }}</p>
        <p class="red font1">2500</p>
      </div>
      <div class="jt-box1">
        <NuxtImg :src="assets.jiantou1Image" alt="Jiantou 1" />
        <div class="warp">
          <div class="warp-box">
            <div class="txt">
              <p>{{ lang.b1_contribution }}</p>
              <span class="red">1320</span>
            </div>
            <div class="txt2">
              <p>{{ lang.other_contributions }}</p>
              <span class="red">C1 e C2 520</span>
            </div>
          </div>
          <div class="warp-box">
            <p class="font1">
              {{ lang.contribute_to_a }} <span class="red">A:440</span>
            </p>
          </div>
          <div class="warp-box">
            <div class="txt">
              <p>{{ lang.b3_contribution }}</p>
              <span class="red">220</span>
            </div>
            <div class="txt2">
              <p>
                {{ lang.c3_contribution }}
              </p>
              <span class="red">C3 0</span>
            </div>
          </div>
        </div>
      </div>
      <div class="BBox">
        <div v-for="agent in agents" :key="agent.id">
          <NuxtImg :src="agent.image" :alt="agent.name" />
          <p>{{ agent.description }}</p>
          <div class="btn">
            <p>{{ lang.valid_bets }}</p>
            <p>{{ agent.bets }}</p>
          </div>
        </div>
      </div>
      <div class="jt-box1">
        <NuxtImg :src="assets.jiantou2Image" alt="Jiantou 2" />
        <div class="warp2">
          <div class="warp-box">
            <div v-for="contribution in contributionsA" :key="contribution.id">
              <p>{{ lang.contribute_to_a }}</p>
              <p class="red">{{ contribution.value }}</p>
            </div>
          </div>
          <div class="warp-box">
            <div v-for="contribution in contributionsB1" :key="contribution.id">
              <p>{{ lang.contribute_to_b1 }}</p>
              <p class="red">{{ contribution.value }}</p>
            </div>
          </div>
        </div>
      </div>
      <div class="BBox CBox">
        <div v-for="agent in cAgents" :key="agent.id">
          <NuxtImg :src="agent.image" :alt="agent.name" />
          <p>{{ agent.description }}</p>
          <div class="btn">
            <p>{{ lang.valid_bets }}</p>
            <p>{{ agent.bets }}</p>
          </div>
        </div>
      </div>
      <p class="font2">{{ lang.for_example }}</p>
      <p class="font3">{{ lang.example_description }}</p>
      <p class="font3">
        <span v-for="bet in betExamples" :key="bet.id">
          * {{ bet.text }}
          <br />
        </span>
      </p>
      <p class="font3">{{ lang.b1_total_performance }}</p>
      <p class="font3">{{ lang.b2_no_subordinate_performance }}</p>
      <p class="font3">{{ lang.b3_performance_breakdown }}</p>
      <p class="font2">{{ lang.bonus_calculation }}</p>
      <p class="font3">1. {{ lang.direct_team }}</p>
      <p class="font3">
        <span v-for="calc in directTeamCalcs" :key="calc.id">
          {{ calc.text }}
          <br />
        </span>
      </p>
      <p class="font3">2. {{ lang.other_teams }}</p>
      <p class="font3">{{ lang.c1_c2_difference }}</p>
      <p class="font3">{{ lang.other_teams_explanation }}</p>
      <p class="font3">3. {{ lang.summary }}</p>
      <p class="font3">
        <span v-for="summary in summaryPoints" :key="summary.id">
          {{ summary.text }}
          <br />
        </span>
      </p>
    </div>
    <div class="item1">
      <p class="font2">{{ lang.definition }}</p>
      <p class="font1">{{ lang.valid_bets_definition }}</p>
      <p class="font1">{{ lang.num_definition }}</p>
    </div>
  </div>
</template>

<script setup lang="ts">
const lang: any = getCurrentPageLang("activity/agente");

interface Agent {
  id: number;
  name: string;
  image: string;
  description: string;
  bets: string;
}

interface Contribution {
  id: number;
  value: string;
}

interface BetExample {
  id: number;
  text: string;
}

interface Calculation {
  id: number;
  text: string;
}

interface SummaryPoint {
  id: number;
  text: string;
}

const assets = {
  faqImage: "/images/activity/agente/faq-01.png",
  renjImage: "/images/activity/agente/renj.png",
  jiantou1Image: "/images/activity/agente/jiantou-01.png",
  jiantou2Image: "/images/activity/agente/jiantou-02.png",
};

const agents: Agent[] = [
  {
    id: 1,
    name: "B1",
    image: "/images/activity/agente/b1.png",
    description: lang.subagent_earns,
    bets: "120K",
  },
  {
    id: 2,
    name: "B2",
    image: "/images/activity/agente/b2.png",
    description: lang.b2_no_subordinates,
    bets: "40K",
  },
  {
    id: 3,
    name: "B3",
    image: "/images/activity/agente/b3.png",
    description: lang.b3_good_subagent,
    bets: "20K",
  },
];

const cAgents: Agent[] = [
  {
    id: 1,
    name: "C1",
    image: "/images/activity/agente/c1.png",
    description: "C1 nǎo tem subordinados por isso nao tem lucros",
    bets: "100K",
  },
  {
    id: 2,
    name: "C2",
    image: "/images/activity/agente/c2.png",
    description: "C2 nǎo tem subordinados por isso nao tem lucros",
    bets: "30K",
  },
  {
    id: 3,
    name: "C3",
    image: "/images/activity/agente/c3.png",
    description: "C3 nǎo tem subordinados por isso nao tem lucros",
    bets: "3000K",
  },
];

const contributionsA: Contribution[] = [
  { id: 1, value: "400" },
  { id: 2, value: "120" },
  { id: 3, value: "0" },
];

const contributionsB1: Contribution[] = [
  { id: 1, value: "400" },
  { id: 2, value: "120" },
  { id: 3, value: "33000" },
];

const betExamples: BetExample[] = [
  { id: 1, text: lang.b1_bets },
  { id: 2, text: lang.b2_bets },
  { id: 3, text: lang.b3_bets },
  { id: 4, text: lang.c1_bets },
  { id: 5, text: lang.c2_bets },
  { id: 6, text: lang.c3_bets },
];

const directTeamCalcs: Calculation[] = [
  { id: 1, text: lang.b1_b2_b3_contribution },
  { id: 2, text: lang.c1_c2_contribution },
  { id: 3, text: lang.d3_contribution },
];

const summaryPoints: SummaryPoint[] = [
  { id: 1, text: lang.c3_powerful_summary },
  { id: 2, text: lang.b2_lazy_summary },
  { id: 3, text: lang.b3_advantage_summary },
  { id: 4, text: lang.fair_model },
];
</script>

<style scoped lang="scss">
.FQA {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-bottom: 1rem;

  .item1 {
    background: var(--theme-color4);
    border-radius: 0.3rem;
    color: var(--theme-neutral1);
    padding: 0.35rem 0.4rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.29rem;

    .font2 {
      font-size: 0.425rem;
      text-align: center;
    }

    .font1 {
      font-size: 0.3rem;
      line-height: 0.5rem;
      color: var(--theme-neutral2);
    }

    .font3 {
      font-size: 0.3rem;
      font-weight: 100;
      color: var(--theme-neutral2);
    }

    .red {
      width: 100%;
      color: var(--theme-dec4);
      width: fit-content;
      margin: auto;
    }

    .img-box {
      margin-top: 0.3rem;
      font-size: 0.34rem;
      position: relative;

      img {
        width: 100%;
      }

      .text div {
        width: 100%;
        padding: 0 0.45rem;
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        position: absolute;
        left: 0;
        top: 2.4rem;
      }
    }

    .user {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 0.2rem;
      margin-top: 0.3rem;
      margin-bottom: 0.3rem;
      position: relative;

      img {
        width: 1.7rem;
        height: 1.69rem;
      }

      div {
        width: 100%;
        margin-top: 0.2rem;
        display: flex;
        flex-direction: column;
        gap: 0.2rem;

        p {
          white-space: nowrap;
        }
      }
    }

    .money {
      display: flex;
      justify-content: space-between;

      .red {
        margin: 0;
      }
    }

    .jt-box1 {
      width: 100%;
      text-align: center;
      font-size: 0.26rem;

      img {
        height: 2.47rem;
      }

      .warp {
        display: flex;
        align-items: center;
        justify-content: space-between;

        .txt {
          margin-bottom: 0.35rem;
        }

        p {
          margin-bottom: 0.1rem;
        }

        .font1 {
          display: flex;
          flex-direction: column;
        }
      }

      .warp2 {
        .warp-box {
          display: flex;
          justify-content: space-between;

          div {
            margin-top: 0.2rem;
          }

          p {
            margin-bottom: 0.1rem;
          }

          .red {
            margin-top: 0.15rem;
          }
        }
      }
    }

    .BBox {
      display: flex;
      justify-content: space-between;

      > div {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        background: var(--theme-color9);
        width: 2.6rem;
        height: 5.15rem;
        overflow: hidden;
        border-radius: 0.2rem;
        align-items: center;
        padding-top: 0.2rem;
        text-align: center;
        color: var(--font-color1);
        line-height: 0.4rem;
        font-size: 0.32rem;
        box-shadow: 0 0.05rem 0.05rem 0.05rem var(--theme-color9);

        img {
          width: 1.2rem;
          height: 1.3rem;
          margin-bottom: 0.37rem;
        }

        .btn {
          width: 100%;
          height: 1.4rem;
          background: var(--theme-color2);
          margin-top: 0.2rem;
          border-radius: 0;
          font-size: 0.32rem;
          display: flex;
          align-items: center;
          align-content: center;
          flex-wrap: wrap;
          justify-content: center;

          > p:last-child {
            margin-top: 0.17rem;
            font-size: 0.37rem;
            font-weight: 600;
            color: var(--theme-dec4);
          }
        }
      }

      &.CBox {
        margin-top: 0.2rem;
      }
    }

    .example-list,
    .calculation-list,
    .summary-list {
      list-style: none;
      padding: 0;
      margin: 0.2rem 0;

      li {
        margin-bottom: 0.1rem;
        padding-left: 1rem;
        text-indent: -1rem;
      }
    }
  }
}
</style>
